package com.example.shopping.service.impl;

import com.example.shopping.mapper.ProductMapper;
import com.example.shopping.model.Product;
import com.example.shopping.service.ProductService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author duoliang.zhang
 * @since 2021/6/25 14:31
 */
@Service
public class ProductServiceImpl implements ProductService {
    private final ProductMapper productMapper;

    public ProductServiceImpl(ProductMapper productMapper) {
        this.productMapper = productMapper;
    }

    @Override
    public List<Product> findAll() {
        return productMapper.findAll();
    }

    @Override
    public boolean deleteById(Long id) {
        return productMapper.deleteById(id);
    }
}
